Skip to content

Instantly share code, notes, and snippets.

Only in Raptor2 Sources/bldc-firmware_2_80: .dep
Only in bldc-cc171422641a50c56452280575f2074f8a88aa45: .gitignore
diff -ru bldc-cc171422641a50c56452280575f2074f8a88aa45/Makefile Raptor2 Sources/bldc-firmware_2_80/Makefile
--- bldc-cc171422641a50c56452280575f2074f8a88aa45/Makefile 2015-12-29 01:37:09.000000000 +0000
+++ Raptor2 Sources/bldc-firmware_2_80/Makefile 2016-09-19 10:07:06.000000000 +0100
@@ -270,8 +270,8 @@
# Program
upload: build/$(PROJECT).bin
#qstlink2 --cli --erase --write build/$(PROJECT).bin
- openocd -f interface/stlink-v2.cfg -c "set WORKAREASIZE 0x2000" -f target/stm32f4x_stlink.cfg -c "program build/$(PROJECT).elf verify reset"
@t00ts
t00ts / app.component.ts
Created November 17, 2016 12:07
Ionic 2 PWA - Controlling browser back button
import { IonicApp, App, MenuController } from 'ionic-angular';
@Component ({...})
export class MyWebApp {
constructor (private _app: App, private _ionicApp: IonicApp, private _menu: MenuController) {
platform.ready().then(() => {
// Do your thing...
@wgins
wgins / people2csv.py
Last active May 31, 2018 19:05 — forked from marinamixpanel/people2csv.py
Mixpanel - Exporting people profiles to CSV
''' people export'''
import base64
import csv
import sys
import time
import urllib # for url encoding
import urllib2 # for sending requests
try:
1. install openjdk
`sudo apt-get install openjdk-7-jdk`
2. install `android sdk`
# 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
@wenzhixin
wenzhixin / ubuntu14.04-command-line-install-android-sdk
Last active July 4, 2024 05:29
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
@siong1987
siong1987 / mrr.rb
Created October 24, 2014 18:31
Stripe MRR Calculation
require 'stripe'
require 'ostruct'
# modified from: https://gist.github.com/jacobpatton/a68d228bf2414852d862
#
# puts Stripe::Mrr.new(api_key: 'api_key').mrr
#
module Stripe
class Mrr
attr_reader :api_key
@dhoelzgen
dhoelzgen / base_controller.rb
Last active October 7, 2021 16:19
CORS in Rails 4 APIs
class API::V1::BaseController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :cors_preflight_check
after_filter :cors_set_access_control_headers
def cors_set_access_control_headers
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'
@juderosen
juderosen / git-wars.md
Last active April 25, 2024 15:16
Git Wars: GitHub vs Bitbucket

Git Wars: GitHub vs Bitbucket

Introduction

Now, you might think the answer I'm going to give you is already obvious because I'm using GiHub right now, but it's not. Both GitHub and Bitbucket offer great Git services, but each has its own features and pricing plans. In the following... thing, I'm going to compare the two and then offer a final solution that should work for most people.

TL;DR: Both. Use GitHub for open source and public repos (you'll spend most of your time here) and Bitbucket for private repos. But, sign up for GitHub first, then import account into Bitbucket. Also, check comments for updates. P.S. I personally prefer GitHub.

Interface and Functionality

@xperiments
xperiments / Dictionary.ts
Created June 25, 2013 18:48
Typescript Dictionary
//http://stackoverflow.com/questions/15877362/declare-and-initialize-a-dictionary-in-typescript
interface IDictionary {
add(key: string, value: any): void;
remove(key: string): void;
containsKey(key: string): bool;
keys(): string[];
values(): any[];
}
@seyhunak
seyhunak / devise.rb
Created July 24, 2012 07:31 — forked from seanaedmiston/devise.rb
Devise Omniauthable
...
# ==> Configuration for any authentication mechanism
# Configure which keys are used when authenticating a user. The default is
# just :email. You can configure it to use [:username, :subdomain], so for
# authenticating a user, both parameters are required. Remember that those
# parameters are used only when authenticating and not when retrieving from
# session. If you need permissions, you should implement that in a before filter.
# You can also supply a hash where the value is a boolean determining whether
# or not authentication should be aborted when the value is not present.
config.authentication_keys = [ :login ]