Skip to content

Instantly share code, notes, and snippets.

View purezen's full-sized avatar

Aditya Bhardwaj purezen

View GitHub Profile
package com.example.purezen_.myapplication;
import android.Manifest;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
@purezen
purezen / App.js
Last active April 28, 2022 05:47
App based on react-transform-boilerplate
import React, { Component } from 'react';
import TaskList from './TaskList';
export default class App extends Component {
constructor(props) {
super(props)
this.state = { tasks: [
{ id: 1, taskText: "task 1" },
{ id: 2, taskText: "task 2" }
]
import threading
def run_program():
work_thread = threading.Thread(target=say_hello)
work_thread.start()
work_thread.join()
print "program end"
def say_hello():
print "heyii.."
import React, { Component } from 'react';
import Menu, {SubMenu, MenuItem, Divider} from 'rc-menu';
export class Header extends Component {
render() {
return (
<Menu>
<MenuItem>1</MenuItem>
<SubMenu title="2">
@purezen
purezen / gist:3fff3d7204546b1e34f5
Created November 23, 2015 13:58
react-task-manager
App.js
import React, { Component } from 'react';
import TaskList from './TaskList';
import AddTask from './AddTask';
export default class App extends Component {
render() {
return (
<div>
@purezen
purezen / crawler.rb
Last active August 29, 2015 14:02
Naive crawler
require 'PageRankr'
@c=0
trap('SIGINT') {puts "\nCrawled #{@c} times."; exit 1; }
output = File.open('naive_crawler.dump.txt', 'w')
File.open('aug_url_list.txt', 'r').each_line do |line|
url=line.split('**')[1]