Skip to content

Instantly share code, notes, and snippets.

View ksarna's full-sized avatar

Kamil Sarna ksarna

View GitHub Profile
@pgtwitter
pgtwitter / file.frag
Last active May 21, 2024 18:01
audio visualizer on glsl-livecoder( https://atom.io/packages/glsl-livecoder )
//audio visualizer on glsl-livecoder ( https://atom.io/packages/glsl-livecoder )
precision mediump float;
uniform float time;
uniform vec2 resolution;
uniform sampler2D spectrum;
uniform sampler2D samples;
uniform float volume;
uniform sampler2D backbuffer;
float PI = 3.14159265359;
@mrzmyr
mrzmyr / index.js
Created November 22, 2015 16:56
React Native - Detect Double Tap
var Index = React.createClass({
getInitialState: function () {
return {
lastPress: 0
}
},
onPress: function () {
var delta = new Date().getTime() - this.state.lastPress;
@jforaker
jforaker / A react-native android Facebook login setup.md
Last active December 9, 2018 12:45
react-native android Facebook login
@cfr
cfr / devert
Last active August 6, 2019 15:08
Fix vertical video
#!/usr/bin/env sh
# http://stackoverflow.com/a/30819570/187663
ffmpeg -i $1 -i $1 -filter_complex "[0:v]scale=-1:720[scaled_video];[1:v]scale=1280:720,boxblur=16[blur_image];[blur_image][scaled_video]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2[outv]" -c:v libx264 -aspect 1280/720 -map [outv] -map 0:a -c:a copy $1.fixed.mp4
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 27, 2024 08:12
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@mikaelbr
mikaelbr / destructuring.js
Last active April 25, 2024 13:21
Complete collection of JavaScript destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@tagrudev
tagrudev / gist:4276467
Created December 13, 2012 13:46
Add custom fonts to your rails application
##
Lets say we have YoloFont.otf
1. We add it to vendor/assets/fonts/ folder
2. Me personaly creates a file named fonts.css.scss in app/assets/stylesheets
In it I have
@font-face{
font-family: 'YoloFont';
@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@rtekie
rtekie / subdomains.rb
Created May 14, 2012 13:14
Support for Rspec / Capybara subdomain integration testing
# Support for Rspec / Capybara subdomain integration testing
# Make sure this file is required by spec_helper.rb
#
# Sample subdomain test:
# it "should test subdomain" do
# switch_to_subdomain("mysubdomain")
# visit root_path
# end
DEFAULT_HOST = "lvh.me"
@bogdanconstantinescu
bogdanconstantinescu / application.rb
Created May 9, 2012 15:26 — forked from t2/application.rb
Formatting Rails form elements for Twitter Bootstrap error validation
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
html = %(<div class="field_with_errors">#{html_tag}</div>).html_safe
# add nokogiri gem to Gemfile
form_fields = [
'textarea',
'input',
'select'
]