Skip to content

Instantly share code, notes, and snippets.

var React = require('react');
var ContentToggle = React.createClass({
render () {
return (
<div className="ContentToggle">
<div className="ContentToggle__Summary">{this.props.summary}</div>
<div className="ContentToggle__Details">Details</div>
</div>
);
}
@mjsxi
mjsxi / SassMeister-input.scss
Last active August 25, 2015 19:21
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
/* first test */
$small: nothing; // fallback for images not uploaded
@mixin testSmall($s: null) {
@if ($s == nothing) {
<?php
/*
* WP_Query - Show in your result search page, How many, products were found.
*/
$mySearch =& new WP_Query("s=$s & showposts=-1"); $num = $mySearch->post_count; ?>
<h1 class="page-title search-products-alert">
Foram encontrados <strong><?php echo $num;?></strong> resultados para a busca: <strong><?php echo get_search_query(); ?></strong>
</h1>
@houshuang
houshuang / cleanup.R
Last active August 25, 2015 19:25
stops working beyond a certain number of elements
elem = function(x,y) { x[[y]]}
splitspc = . %>% as.character %>% strsplit(' ', fixed=TRUE) %>% unlist
a = dbraw$V6 %>% head(n=10000000) %>% laply(splitspc)
method =a[1,]
url = a[2,]
# output:
# > a = dbraw$V6 %>% head(n=100) %>% laply(splitspc)
# > a = dbraw$V6 %>% head(n=1000) %>% laply(splitspc)
# > a = dbraw$V6 %>% head(n=10000) %>% laply(splitspc)
/*** inside Angular **/
var someService = function($q, $http) {
var service = this;
service.findSomething = function(query) {
var somePromise = $q.defer()
$http.get(/*something well done here */).then(function(data){
somePromise.resolve(data);
@ballance
ballance / The Technical Interview Cheat Sheet.md
Last active August 25, 2015 19:27 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
.hidden-sm,
.hidden-md,
.hidden-lg {
.show;
}
.hidden-sm {
@media (max-width: @screen-sm) {
.hide;
}
for (var i = 1; i < 101; i ++){
if (i % 15 == 0){
console.log('FizzBuzz');
}
else if (i % 5 == 0) {
console.log('Buzz');
}
else if (i % 3 == 0) {
console.log ('Fizz');
}
@firebellys
firebellys / The Technical Interview Cheat Sheet.md
Last active August 25, 2015 19:29 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.