Skip to content

Instantly share code, notes, and snippets.

View sankalpsingha's full-sized avatar

Sankalp Singha sankalpsingha

View GitHub Profile
@sankalpsingha
sankalpsingha / Ajax Ember Prefilter
Created November 12, 2014 14:41
This is the Ajax prefilter for Rails to be used for the CSRF with EmberJS
$(->
token = $('meta[name="csrf-token"]').attr('content')
$.ajaxPrefilter((options, originalOptions, xhr)->
xhr.setRequestHeader('X-CSRF-Token', token)
)
)
-- model
some sort of constant hash:
HASH_NAME = {
0 => "Choose:",
1 => "On-Campus Recruiting - CSO",·
2 => "CSO Staff Referral",
3 => "Faculty Contact",·
4 => "Career Day",·
5 => "CSO Summer Job Listing",·
6 => "Alumni Contact",·
@sankalpsingha
sankalpsingha / Quadtrust Brochure Design ( HTML ).markdown
Last active August 29, 2015 14:23
Quadtrust Brochure Design ( HTML )
import React, { Component } from 'react';
import { View } from 'react-native';
import { createStore, applyMiddleware } from 'redux';
import { logger } from 'redux-logger';
import { Provider } from 'react-redux';
import Reducers from './reducers/';
import LoginForm from './components/LoginForm';
class App extends Component {
import React, { Component } from 'react';
import { View } from 'react-native';
import { Hoshi } from 'react-native-textinput-effects';
import Button from 'react-native-button';
import { connect } from 'react-redux';
import { emailChanged, passwordChanged } from '../actions/';
class LoginForm extends Component {
emailChanged(value) {
this.props.emailChanged(value);
/*global fetch:false*/
export const emailChanged = (email) => {
return {
type: 'EMAIL_CHANGED',
payload: email
};
};
export const passwordChanged = (password) => {
return {
const INITIAL_STATE = {
email: '',
password: '',
authentication_token: '',
username: '',
errorFlag: false,
spinner: false
};
export default (state = INITIAL_STATE, action) => {
import React, { Component } from 'react';
import { View, Text, ActivityIndicator } from 'react-native';
import { Hoshi } from 'react-native-textinput-effects';
import Button from 'react-native-button';
import _ from 'lodash';
import { connect } from 'react-redux';
import { emailChanged, passwordChanged, loginUser } from '../actions/';
class LoginForm extends Component {
onButtonSubmit() {
function convertToRoman(num) {
var firstTable = {
0: '',
1: 'I',
2: 'II',
3: 'III',
4: 'IV',
5: 'V',
6: 'VI',
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Simon Game</title>
<style media="screen">
*{
margin: 0;
padding: 0;
}