Skip to content

Instantly share code, notes, and snippets.

var app = require('app');
var BrowserWindow = require('browser-window');
app.on('window-all-closed', function() {
app.quit();
});
app.on('ready', function() {
new BrowserWindow({width: 1024, height: 600})
.loadUrl('http://mozilla.github.io/pdf.js/web/viewer.html')
'use strict'
### Sevices ###
angular.module('app.services', [])
.factory 'version', -> "0.1"
# COPIAR DAQUI PARA BAIXO
.service 'historyService', class
constructor: (@$window, $rootScope, $location)->
<?php
$notas = [
999 => 8,
456 => 3,
789 => 5,
123 => 2,
]; // 8 5 3 2
asort($notas);
# cria um emulador ios para cordova
cordova create emulator
cd emulator
git init
git add .
git commit -m 'cordova create emulator'
for name in battery-status camera console contacts device device-motion device-orientation dialogs file file-system-roots file-transfer geolocation globalization inappbrowser media media-capture network-information plugin.softkeyboard speech.speechsynthesis splashscreen statusbar vibration
do
<?php
use Isse\Db\SetUp;
require_once __DIR__ . '/../bootstrap/execsh.php';
$host = DB_HOST;
$db = DB_NAME;
$oracle_pdo = new PDO("oci:dbname=$host/$db", DB_USER, DB_PWD);
$oracle_pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
<?php
class DB2PHP {
public function __construct($dir, $conn, $records_per_page = 1000) {
@mkdir($dir);
$this->dir = $dir;
$this->conn = $conn;
$this->records_per_page = $records_per_page;
}
<?php
class DB2PHP {
public function __construct($dir, $conn, $records_per_page = 1000) {
@mkdir($dir);
$this->dir = $dir;
$this->conn = $conn;
$this->records_per_page = $records_per_page;
}
<?php
$file = $argv[1];
$pdo = new PDO('mysql:host=localhost;dbname=log', 'root', '');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $pdo->prepare("INSERT INTO logs SET
data = ?,
elapse = ?,
ip = ?,
@neves
neves / fiddle.response.json
Last active August 29, 2015 14:02
fiddle.response.json
[{"value":"john"},{"value":"julia"},{"value":"johnson"},{"value":"juliet"}]
# shell functions to setup rails features
# https://gist.github.com/c6180ddda37377a8613a
# rt == rails_template
# source rails-template.sh
# rails new appname -B
# cd appname
rt_init() {
git init
git add .