Skip to content

Instantly share code, notes, and snippets.

@dodyw
dodyw / resetAllSimulators.sh
Created January 29, 2019 08:05 — forked from ZevEisenberg/resetAllSimulators.sh
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all
@dodyw
dodyw / README.md
Created March 1, 2018 17:48 — forked from erichrobinson/README.md
SwitchResX Configuration

#SwitchResX Settings for LG 21:9 UltraWide

SwitchResX is a utility that allows users to override the default resolution settings in OSX. For more information, including download links, vist http://www.madrau.com/ .

##Disabling System Integrity Protection (SIP)

If you are running OSX 10.11 or higher, SIP must be disabled. To disable SIP do the following:

  • Boot into the recovery partition by pressing CMD + R when starting up your Mac.
  • Once in recovery mode, open a terminal window.
  • Type the command csrutil disable
@dodyw
dodyw / gist:1c012600a30a6dc5d48ea180f701e329
Created December 9, 2017 14:51 — forked from rtrouton/gist:f92f263414aaeb946e54
Install Xcode command line tools on 10.7.x - 10.10.x. Tested on 10.7.5, 10.8.5, 10.9.5 and 10.10.2.
#!/bin/bash
# Installing the Xcode command line tools on 10.7.x or higher
osx_vers=$(sw_vers -productVersion | awk -F "." '{print $2}')
cmd_line_tools_temp_file="/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress"
# Installing the latest Xcode command line tools on 10.9.x or higher
if [[ "$osx_vers" -ge 9 ]]; then
@dodyw
dodyw / ubuntu14.04-command-line-install-android-sdk
Created December 9, 2016 23:11 — forked from wenzhixin/ubuntu14.04-command-line-install-android-sdk
Ubuntu 14.04 command line install android sdk
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages
@dodyw
dodyw / latest-ffmpeg-centos6.sh
Created December 7, 2016 00:17 — forked from mustafaturan/latest-ffmpeg-centos6.sh
Installs latest ffmpeg on Centos 6
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
@dodyw
dodyw / eloquent.php
Last active August 29, 2015 14:06 — forked from ziadoz/eloquent.php
<?php
class Post
{
protected $table = 'posts';
/**
* You can define your own custom boot method.
*
* @return void
**/
@dodyw
dodyw / init-rpm.sh
Last active December 18, 2015 14:59 — forked from anonymous/gist:5801559
script to start and stop redis as daemon - tested on fedora
#!/bin/sh
#
# script to start and stop redis as daemon
#
# chkconfig: - 85 15
# description: redis is a non-relational database storage system.
# processname: redis
# config: /opt/redis/redis.conf
# binary: /opt/redis/redis-server
@dodyw
dodyw / rows.php
Last active December 15, 2015 00:59 — forked from anonymous/rows.php
<img class="thumbnail alignleft" src="http://images.thumbshots.com/image.aspx?cid=xxxxx&v=1&w=120&url=<?php print urlencode($v['url']) ?>" border="1" alt="<?php print $v['title'] ?>" />

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@dodyw
dodyw / app.js
Created January 20, 2012 13:38 — forked from dawsontoth/app.js
Rate my app in Appcelerator Titanium Mobile
/**
* The following snippet will ask the user to rate your app the second time they launch it.
* It lets the user rate it now, "Remind Me Later" or never rate the app.
*/
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
win.addEventListener('open', checkReminderToRate);
win.add(Ti.UI.createLabel({ text: 'This is a simple app that will remind you to rate it.' }));
win.open();
function checkReminderToRate() {