Skip to content

Instantly share code, notes, and snippets.

View jsam's full-sized avatar
🦁

sam jsam

🦁
View GitHub Profile
@jsam
jsam / gist:c9e9a19134df31975e88
Created January 31, 2015 12:09
what it will print out?
function test() {
console.log(a);
console.log(foo());
var a = 1;
function foo() {
return 2;
}
}
@jsam
jsam / ble device model
Created December 4, 2014 09:14
ble device model
package com.trackfox.android.models;
import android.bluetooth.BluetoothDevice;
import android.util.Log;
import java.lang.reflect.Method;
/**
* Created by Sam on 2.12.2014..
*/
@jsam
jsam / gist:1b85ebb4d7020fea91b0
Created August 15, 2014 14:34
my ETL with dataset/sqlalchemy with some sample data users->albums->photos
import dataset
import json
import yaml
from lxml import etree
db = dataset.connect('sqlite:///data.db')
@jsam
jsam / 0_reuse_code.js
Created July 2, 2014 23:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
var ButtonUpload = (function()
{
var options =
{
input: Object,
button: Object,
photoPlaceholder: Object,
photoOptions:
{
class: String,
..[dev@blackbook] - [~/Develop/kalashnikov-522/kalashnikovdb-code/src] - [Tue Apr 29, 03:29]
..[$] <( (svn)-[code:522]-)> make swig
cd swig && swig -python kalashnikovDB.i && python setup.py build_ext --inplace && cd ..
../file/table.h:30: Warning 302: Identifier 'AK_create_table' redefined (ignored),
../file/table.c:50: Warning 302: previous definition of 'AK_create_table'.
../trans/transaction.c:30: Warning 302: Identifier 'observable_transaction' redefined (ignored),
../trans/transaction.h:48: Warning 302: previous definition of 'observable_transaction'.
../sql/command.h:8: Warning 302: Identifier 'AK_command' redefined (ignored),
../sql/command.c:50: Warning 302: previous definition of 'AK_command'.
../dm/dbman.h:110: Warning 454: Setting a pointer/reference variable may leak memory.
..[dev@blackbook] - [~/Develop/kalashnikov-522/kalashnikovdb-code/src] - [Tue Apr 29, 03:29]
..[$] <( (svn)-[code:522]-)> make swig
cd swig && swig -python kalashnikovDB.i && python setup.py build_ext --inplace && cd ..
../file/table.h:30: Warning 302: Identifier 'AK_create_table' redefined (ignored),
../file/table.c:50: Warning 302: previous definition of 'AK_create_table'.
../trans/transaction.c:30: Warning 302: Identifier 'observable_transaction' redefined (ignored),
../trans/transaction.h:48: Warning 302: previous definition of 'observable_transaction'.
../sql/command.h:8: Warning 302: Identifier 'AK_command' redefined (ignored),
../sql/command.c:50: Warning 302: previous definition of 'AK_command'.
../dm/dbman.h:110: Warning 454: Setting a pointer/reference variable may leak memory.
..[dev@blackbook] - [~/Develop/kalashnikov-522/kalashnikovdb-code/src] - [Tue Apr 29, 03:16]
..[$] <( (svn)-[code:522]-)> make swig
cd swig && swig -python kalashnikovDB.i && python setup.py build_ext --inplace && cd ..
../file/table.h:30: Warning 302: Identifier 'AK_create_table' redefined (ignored),
../file/table.c:50: Warning 302: previous definition of 'AK_create_table'.
../trans/transaction.c:30: Warning 302: Identifier 'observable_transaction' redefined (ignored),
../trans/transaction.h:48: Warning 302: previous definition of 'observable_transaction'.
../sql/command.h:8: Warning 302: Identifier 'AK_command' redefined (ignored),
../sql/command.c:50: Warning 302: previous definition of 'AK_command'.
../dm/dbman.h:110: Warning 454: Setting a pointer/reference variable may leak memory.
@jsam
jsam / gist:9074485
Last active August 29, 2015 13:56
old integral
#include<iostream.h> //for cout & cin
#include<conio.h> //for getch() & clrscr()
#include<math.h> //for any mathematical function
#define n 100000;
void main()
{
clrscr();
double a,b,temp,s=0.0,x;
double y;
@jsam
jsam / gist:8942287
Last active August 29, 2015 13:56
e
// Znaci link ti mora izgledati "https://halycon.tv/public/" + $rootScope.channel_owner + "/?fullscreen=true"
// i onda procitas parametar iz url-a na sljedeci nacin:
// var fullscreen = getParameterByName('fullscreen');
// if (fullscreen)
// show_fullscreen()
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));