Skip to content

Instantly share code, notes, and snippets.

View codewisdom's full-sized avatar
🎯
Focusing

Sam codewisdom

🎯
Focusing
View GitHub Profile
@codewisdom
codewisdom / rn.js
Created May 1, 2019 21:40
React Native Absolute positioning
//This can be done other ways...
centerAll: {
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
justifyContent: "center",
alignItems: "center"
@codewisdom
codewisdom / runthis.sh
Created May 1, 2019 01:20
Quicktime Compatible ffmpeg conversion
ffmpeg -I in.mov -c:v libx265 -preset slow -crf 26 -vtag hvc1 -c:a aac -map_metadata 0 out.mp4
@codewisdom
codewisdom / nthFib.js
Created September 25, 2018 18:50
nthFib
function nthFibonacciP(n) {
let left = 0;
let right = 1;
if(n < 2) {
return n;
}
for(let i = 2; i <= n; i++) {
let temp_right = right;
right = left + right;
left = temp_right;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
namespace greedymatch
{
class Program
{
static void Main(string[] args)
@codewisdom
codewisdom / gulpfile.js
Created March 15, 2018 00:43 — forked from lmartins/gulpfile.js
Show sass compilation errors in the browser
var gulp = require("gulp");
var sass = require("gulp-sass");
var autoprefix = require("gulp-autoprefixer");
var filter = require('gulp-filter');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
/**
* Start BrowserSync
*/

Keybase proof

I hereby claim:

  • I am codewisdom on github.
  • I am codewisdom (https://keybase.io/codewisdom) on keybase.
  • I have a public key whose fingerprint is BD3C D1F7 653C 9EF4 00E8 57FB 98CA 1553 4C9D F99D

To claim this, I am signing this object:

@codewisdom
codewisdom / chruby_ruby-build.sh
Created February 27, 2016 20:34 — forked from havenwood/chruby_ruby-build.sh
On Debian, Ubuntu, or Mint: install Ruby with chruby and ruby-build
# Install apt-get packages:
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
# Install chruby:
cd
wget https://github.com/downloads/postmodern/chruby/chruby-0.2.3.tar.gz
tar -xzvf chruby-0.2.3.tar.gz
cd chruby-0.2.3
sudo make install
@codewisdom
codewisdom / README.md
Last active February 24, 2016 07:19 — forked from estebistec/README.md
This minimal setup allows you to run nginx using the current folder as the doc-root. NOTE: python's simplehttpserver may be good enough for you. This is just a nice simple nginx setup.
  1. Get all of these files into the target folder
  2. Run the following commands:
chmod +x *.sh
./nginx-start.sh
@codewisdom
codewisdom / 0_reuse_code.js
Created January 13, 2016 21:19
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
class SubmitButton < UIButton
def self.make(params={})
# return instance of SubmitButton (or any subclass)
@submitButton = self.buttonWithType(UIButtonTypeRoundedRect)
@submitButton.frame = params[:frame]
# defaults
@submitButton.titleLabel.font = UIFont.systemFontOfSize(14)
@submitButton.titleLabel.text = "Submit"
@submitButton.titleLabel.backgroundColor = UIColor.grayColor