Skip to content

Instantly share code, notes, and snippets.

@dinnouti
dinnouti / example1.cs.coffee
Created October 7, 2012 16:27
Replace input select with jquery ui autocomplete
asd = ->
$('.shipping').each ->
option = []
$(this).find('option').each ->
option.push $(this).text()
input = $('<input>')
input.attr('type','text')
input.attr('name', $(this).attr('name') )
input.attr('id', $(this).attr('id') )
@dinnouti
dinnouti / _form.html.erb
Created October 15, 2012 22:59
Typeahead / Autocomplete with Twitter Bootstrap, Rails, simple_form
<%= f.input :nome, :collection => get_schools_name, :include_blank => false, :input_html => {:rel => 'autocomplete', :data_default => @school.nome} %>
@dinnouti
dinnouti / gist:5204483
Created March 20, 2013 13:05
bring empty records in a report builder query
-- lookup query
select
-1 as country_work_impact_id,
'[any]' as country_work_impact_name
union all
SELECT DISTINCT
country_work_impact_id,
country_work_impact_name
FROM V_Matrix_FY14_Aggregate
var mediaType = "ED"; // ED for streaming; 1 for DVD
var lxMovies = new Array();
function lxMovie(title, starRating, id) {
this.title = title;
this.starRating = starRating;
this.id = id;
}
@dinnouti
dinnouti / index.html.erb
Created June 6, 2013 11:42
Adding state_machine events to link_to
enable: <%= link_to 'Enable', user_update_state_path(user.id, state_event: 'register', access_state_event: 'enable') %><br>
disable: <%= link_to 'disable', user_update_state_path(user.id, state_event: 'unregister', access_state_event: 'disable') %>
@dinnouti
dinnouti / loadPointsFromFirms.ini
Created September 14, 2013 15:00
Load points from NASA FIRMS into a SQL Database via ArcGIS 10.2. NASA only keeps 15 days of FIRMS data hence the reason to keep the CSV file.
; configuration file
[test]
logging_file = D:/firecast_data/script_logs/firms_log.txt
;1 = file , 2 = stdout
logging_streaming = 1
; ftp information
ftp_host = <ftp host address>
@dinnouti
dinnouti / photo.html
Created September 14, 2013 15:16
jQuery Shadowbox and Photo Library
<!-- script begin -->
<script type="text/javascript" src="/_layouts/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/_layouts/js/shadowbox/shadowbox.js"></script>
<link rel="stylesheet" type="text/css" href="/_layouts/js/shadowbox/shadowbox.css">
<script type="text/javascript">
Shadowbox.init({
language: 'en',
players: ['img','swf','flv']
});
@dinnouti
dinnouti / bookmark.json
Last active December 23, 2015 15:19
Chrome Extension to show company bookmarks Notes: - Stores the bookmarks in the local browser database, until the cache expires in the cacheTimeout (in seconds) - Todo: use the json file to create the tabs automatically instead of hard code in the html
bookmark({
"cacheTimeout" : "3600",
"tools": [
{ "vpn": false, "title": "ABC1" , "url": "http://example1.com" },
{ "vpn": false, "title": "ABC2" , "url": "http://example2.com" }
],
"sites": [
{ "vpn": false, "title": "ABC3" , "url": "http://example3.com" },
{ "vpn": true, "title": "ABC4" , "url": "http://example4.com" }
@dinnouti
dinnouti / conkyrc
Last active August 29, 2015 14:02
conky file for linux mint
alignment top_right
background no
border_width 1
cpu_avg_samples 2
default_color cornflowerblue
default_outline_color white
default_shade_color white
draw_borders no
<script src='https://code.jquery.com/jquery-1.11.1.min.js'></script>
<script>
function getjs(){
$.getJSON("hashtag.json", function(data) {
console.log(data.total); // this will show the info it in firebug console
});
}
</script>
<button onclick="getjs()">Test</button>