Skip to content

Instantly share code, notes, and snippets.

@Tasemu
Tasemu / scrape.rake
Last active December 25, 2015 18:28
HTML Scraper Practise
task :scrape => :environment do
require 'nokogiri'
require 'open-uri'
text = []
invalid = []
i = 0
File.read("text.txt").each_line do |line|
<h1>Listing jobs</h1>
<table>
<thead>
<tr>
<th>Title</th>
<th>Description</th>
<th>Tea</th>
<th></th>
<th></th>
@Tasemu
Tasemu / project.js
Last active December 31, 2015 14:49
Projects and tasks with angularjs
App.factory('Project', function($resource) {
return $resource(
'/api/v1/projects/:id.json',
{id: '@id'},
{
update: {
method: 'PUT',
params: { id: '@id' },
isArray: false
}
@Tasemu
Tasemu / contollers.js
Created May 26, 2014 03:54
Consuming a rest interface using $resource
app.controller('UserCtrl', ['$scope', 'User', function ($scope, User) {
User.query().$promise.then(function (users) {
console.log(users[0]);
});
}]);
@Tasemu
Tasemu / home-controller.js
Created January 27, 2015 11:35
infinite scroll error
app.controller('homeController', function ($scope, manga, $timeout) {
console.log('homeController Initialized');
$scope.visibleManga = [];
manga.getNewManga(function (manga) {
$scope.newManga = manga;
$scope.visibleManga = $scope.newManga.slice(1, 25);
$scope.app.loading = false;
});
$scope.loadMore = function() {
@Tasemu
Tasemu / main.js
Last active August 29, 2015 14:15
/** @jsx React.DOM */
(function (React) {
var data = [
'Go to work',
'Play Albion Online',
'Keep learning React'
]
#include <iostream>;
using namespace std;
int betty = 5;
void changeBetty (x) {
betty = x;
}
void main () {
#include <iostream>
using namespace std;
void doubleNumbers (int x) {
cout << x * 2 << endl;
}
void doubleNumbers (double x) {
cout << x * 2 << endl;
}
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "Hero.h"
using namespace std;
void mainmenu();
void createNewHero();
@Tasemu
Tasemu / quickfight.cpp
Created March 9, 2015 13:15
learning c++
#include <iostream>
#include <string>
using namespace std;
class Enemy {
protected:
int attackPower;
int hp;
public:
void setAttackPower (int x) {